home *** CD-ROM | disk | FTP | other *** search
/ Ham Radio 2000 / Ham Radio 2000.iso / ham2000 / misc / dspice0s / nxtpwr.c < prev    next >
C/C++ Source or Header  |  1992-11-21  |  2KB  |  116 lines

  1. /* nxtpwr.f -- translated by f2c (version of 3 February 1990  3:36:42).
  2.    You must link the resulting object file with the libraries:
  3.     -lF77 -lI77 -lm -lc   (in that order)
  4. */
  5.  
  6. #include "f2c.h"
  7.  
  8. /*<       subroutine nxtpwr(pwrseq,pdim) >*/
  9. /* Subroutine */ int nxtpwr_(pwrseq, pdim)
  10. integer *pwrseq, *pdim;
  11. {
  12.     /* System generated locals */
  13.     integer i_1;
  14.  
  15.     /* Local variables */
  16.     static integer psum, i, k, km1;
  17.  
  18.     /* Parameter adjustments */
  19.     --pwrseq;
  20.  
  21.     /* Function Body */
  22. /*<       implicit double precision (a-h,o-z) >*/
  23.  
  24. /*     this routine determines the 'next' set of exponents for the */
  25. /* different dimensions of a polynomial. */
  26.  
  27. /*<       integer pwrseq(1),pdim,psum >*/
  28.  
  29.  
  30. /*<       if (pdim.eq.1) go to 80 >*/
  31.     if (*pdim == 1) {
  32.     goto L80;
  33.     }
  34. /*<       k=pdim >*/
  35.     k = *pdim;
  36. /*<    10 if (pwrseq(k).ne.0) go to 20 >*/
  37. L10:
  38.     if (pwrseq[k] != 0) {
  39.     goto L20;
  40.     }
  41. /*<       k=k-1 >*/
  42.     --k;
  43. /*<       if (k.ne.0) go to 10 >*/
  44.     if (k != 0) {
  45.     goto L10;
  46.     }
  47. /*<       go to 80 >*/
  48.     goto L80;
  49. /*<    20 if (k.eq.pdim) go to 30 >*/
  50. L20:
  51.     if (k == *pdim) {
  52.     goto L30;
  53.     }
  54. /*<       pwrseq(k)=pwrseq(k)-1 >*/
  55.     --pwrseq[k];
  56. /*<       pwrseq(k+1)=pwrseq(k+1)+1 >*/
  57.     ++pwrseq[k + 1];
  58. /*<       go to 100 >*/
  59.     goto L100;
  60. /*<    30 km1=k-1 >*/
  61. L30:
  62.     km1 = k - 1;
  63. /*<       do 40 i=1,km1 >*/
  64.     i_1 = km1;
  65.     for (i = 1; i <= i_1; ++i) {
  66. /*<       if (pwrseq(i).ne.0) go to 50 >*/
  67.     if (pwrseq[i] != 0) {
  68.         goto L50;
  69.     }
  70. /*<    40 continue >*/
  71. /* L40: */
  72.     }
  73. /*<       pwrseq(1)=pwrseq(pdim)+1 >*/
  74.     pwrseq[1] = pwrseq[*pdim] + 1;
  75. /*<       pwrseq(pdim)=0 >*/
  76.     pwrseq[*pdim] = 0;
  77. /*<       go to 100 >*/
  78.     goto L100;
  79. /*<    50 psum=1 >*/
  80. L50:
  81.     psum = 1;
  82. /*<       k=pdim >*/
  83.     k = *pdim;
  84. /*<    60 if (pwrseq(k-1).ge.1) go to 70 >*/
  85. L60:
  86.     if (pwrseq[k - 1] >= 1) {
  87.     goto L70;
  88.     }
  89. /*<       psum=psum+pwrseq(k) >*/
  90.     psum += pwrseq[k];
  91. /*<       pwrseq(k)=0 >*/
  92.     pwrseq[k] = 0;
  93. /*<       k=k-1 >*/
  94.     --k;
  95. /*<       go to 60 >*/
  96.     goto L60;
  97. /*<    70 pwrseq(k)=pwrseq(k)+psum >*/
  98. L70:
  99.     pwrseq[k] += psum;
  100. /*<       pwrseq(k-1)=pwrseq(k-1)-1 >*/
  101.     --pwrseq[k - 1];
  102. /*<       go to 100 >*/
  103.     goto L100;
  104. /*<    80 pwrseq(1)=pwrseq(1)+1 >*/
  105. L80:
  106.     ++pwrseq[1];
  107.  
  108. /*  finished */
  109.  
  110. /*<   100 return >*/
  111. L100:
  112.     return 0;
  113. /*<       end >*/
  114. } /* nxtpwr_ */
  115.  
  116.